import React from 'react';
import css from './index.less';
import { observer } from 'mobx-react';
import PropTypes from 'prop-types';

@observer
export default class ImgRender extends React.Component {

  static propTypes = {
    mod: PropTypes.object,
  };

  isDelete() {
    const { delArea = () => {}, ind } = this.props;
    delArea(ind);
  }
  mouseDown() {
    const { mouseDown = () => {}, ind} = this.props;
    mouseDown(ind);
  }

  render() {
    const { mod } = this.props;

    const imgProps = {
      className: css.image,
      style: mod.styleImg,
      src: mod.src,
      onMouseDown: this.mouseDown.bind(this),
    };
    return (

      <img {...imgProps}/>

    );
  }
}
